<?php

namespace app\api\controller;

use think\Controller;

class Article extends Controller
{
    /**
     * 协议、文章详情
     */
    public function article_details($header, $data, $user)
    {
        $check = check_array($data, array('number'));
        if ($check['code'] != 1) {
            return $check;
        }
        $article = db('article')
            ->where(array('status' => 1,'number'=>$data['number']))
            ->order("id desc")
            ->find();
        if(empty($article)){
            return array('code' => 2, 'msg' => '没有该协议、文章', 'data' => array());
        }
        $article1=array('id'=>$article['id'],'title'=>$article['title'],'create_time'=>date('Y-m-d H:i:s',$article['create_time']),'content'=>$article['content']);
        return array('code' => 1, 'msg' => '提货、收货时间', 'data' => $article1);
    }
}